/* DataDownTask.java
 *
 * Project/Product: GW
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   Jackey	2008-3-3	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package system.imp;

import java.util.TimerTask;

import framework.core.DBConnection;

import system.base.InputDataSrv;

/**
* GW定时任务
*/
public class DataDownTask extends TimerTask {
   
   
   public void run(){
       DBConnection con = null;
       try{
           con = DBConnection.open(false);
           
           con.setAutoCommit(false);
           //产品分类
           try{               
               InputDataSrv ids = new InputDataSrv();
               ids.doInputCategoryData(con, null, null);
           }
           catch(Exception e)
           {
               
           }
       
           //供应商信息
           try{
               InputDataSrv ids = new InputDataSrv();
               ids.doInputProviderData(con, null, null);
           }
           catch(Exception e)
           {
               
           }
           
           //产品信息
           try{
               InputDataSrv ids = new InputDataSrv();
               ids.doInputProductData(con, null, null);               
           }
           catch(Exception e)
           {
               
           } 
           con.commit();
           
       }catch(Exception e)
       {
           try{
               con.rollback();
           }catch(Exception e1)
           {
               
           }
       }finally{
           try{
               if (con != null)
                   con.close();
           }catch(Exception e)
           {
               
           }
       }
       
   }

   /**
    * @param args
    */
   public static void main(String[] args) {
   // TODO Auto-generated method stub

   }

}

